package com.hencoderplus.demo1;

import android.content.Context;
import android.util.AttributeSet;
import android.view.View;
import android.view.ViewGroup;

/**
 * hencoderplus
 * Created by lzw on 2018/11/1. 15:33:05
 * 邮箱：632393724@qq.com
 * All Rights Saved! Chongqing AnYun Tech co. LTD
 */
public class TagLayout1 extends ViewGroup {

    public TagLayout1(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    @Override
    protected void onLayout(boolean changed, int l, int t, int r, int b) {
        for (int i = 0; i < getChildCount(); i++) {
            View child = getChildAt(i);
            if (i==0)
            child.layout(l,t,(l+r)/2,(t+b)/2);
            else {
            child.layout((l+r)/2,(t+b)/2,r,b);

            }
        }
    }
}
